package com.otherTest.designpattern.creationalpattern.abstractfactory.phonecolor;


import com.otherTest.designpattern.creationalpattern.abstractfactory.PhoneAbstractFactory;
import com.otherTest.designpattern.creationalpattern.abstractfactory.phoneversion.PhoneVersion;

import java.util.Objects;

/**
 * @Description:
 * @author: conceit
 * @Date: 2018/8/31 0031 14:20
 */
public class PhoneColorFactory extends PhoneAbstractFactory {


    @Override
    public PhoneColor selectPhoneColor(String phoneColor) {
        if(Objects.isNull(phoneColor)){
            return null;
        }
        if("black".equalsIgnoreCase(phoneColor)){
            return new PhoneColorBlack();
        }else if("red".equalsIgnoreCase(phoneColor)){
            return new PhoneColorRed();
        }
        return null;
    }

    @Override
    public PhoneVersion selectPhoneVersion(String phoneVersion) {
        return null;
    }
}
